package universal

import (
	stdContext "context"
	"gitee.com/xlizy/common-go/base/common_rpc"
	"gitee.com/xlizy/common-go/base/response"
	"gitee.com/xlizy/common-go/utils/json"
	"gitee.com/xlizy/common-go/utils/zlog"
	"gitee.com/xlizy/rpc-interface/rpc_pbs"
)

func SaveUserOperationBehavior(req *rpc_pbs.UserOperationBehaviorReq) *response.Response {
	defer func() {
		if err := recover(); err != nil {
			zlog.Info("保存用户操作行为异常,msg:{}", json.ToJsonStr(req))
			zlog.Error("异常信息:{}", err)
		}
	}()

	rsp := common_rpc.R(common_rpc.UniversalServiceClientImpl().SaveUserOperationBehavior(stdContext.TODO(), req))
	if rsp.Success {
		return rsp
	} else {
		zlog.Info("保存用户操作行为失败,msg:{}", rsp.Msg)
		return rsp
	}
}
